var Converter = function()
{

};

/*
 * elapsed time in second.
 */
Converter.ElapsedTimeToHumanReadable = function(elapsed)
{

	var dSeconds = elapsed;
	var dMinutes = 0;
	var dHours = 0;
	var dDays    = 0;

	var result = "";

	if(dSeconds >= 60)
	{
		result=dSeconds%60+" s "+result;
		dMinutes = Math.floor(dSeconds / 60);
	}
	else
	{
		result=dSeconds+" s "+result;
	}

	if(dMinutes >= 60)
	{
		result=dMinutes%60+" m "+result;
		dHours = Math.floor(dMinutes / 60);
	}
	else if(dMinutes>0)
	{
		result=dMinutes+" m "+result;
	}

	if(dHours >= 60)
	{
		result=dHours%60+" h "+result;
		dDays = Math.floor(dHours / 24);
	}
	else if(dHours>0)
	{
		result=dHours+" h "+result;
	}

	if(dDays > 0)
	{
		result=dHours+" d "+result;
	}
	
	return result;
};
